<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  
</body>
<script src="./axios.js"></script>
<script>
  /*
    get请求的简化写法
    axios.get('url地址',{参数和配置信息})
    axios.get('http://localhost:8888/users/update',{
      params:{

      },
      headers:{
        "autorization":token
      }
    })

    post请求简化写法
    axios.post('url地址',{参数},{配置信息})
    axios.post('http://localhost:8888/users/update',{
      username:'zs'
    },
    {
      headers:{
        "autorization":token
      }
    }
    )
  */ 
  //配置url基准地址
  axios.defaults.baseURL ='http://localhost:8888'

  axios.get('/users/update',{
      params:{

      },
      headers:{
        "autorization":token
      }
    })

  axios.post('/users/update',{
    username:'zs'
  },
  {
    headers:{
      "autorization":token
    }
  }
  )
</script>
</html>